#ifdef INET6
struct block *
-gen_mcode6(compiler_state_t *cstate, const char *s1, const char *s2,
- bpf_u_int32 masklen, struct qual q)
+gen_mcode6(compiler_state_t *cstate, const char *s, bpf_u_int32 masklen,
+ struct qual q)
{
struct addrinfo *res;
struct in6_addr *addr;
if (setjmp(cstate->top_ctx))
return (NULL);
- if (s2)
- bpf_error(cstate, "no mask %s supported", s2);
-
- res = pcap_nametoaddrinfo(s1);
+ res = pcap_nametoaddrinfo(s);
if (!res)
- bpf_error(cstate, "invalid ip6 address %s", s1);
+ bpf_error(cstate, "invalid ip6 address %s", s);
cstate->ai = res;
if (res->ai_next)
- bpf_error(cstate, "%s resolved to multiple address", s1);
+ bpf_error(cstate, "%s resolved to multiple address", s);
addr = &((struct sockaddr_in6 *)res->ai_addr)->sin6_addr;
if (masklen > sizeof(mask.s6_addr) * 8)
memcpy(m, &mask, sizeof(m));
if ((a[0] & ~m[0]) || (a[1] & ~m[1])
|| (a[2] & ~m[2]) || (a[3] & ~m[3])) {
- bpf_error(cstate, "non-network bits set in \"%s/%d\"", s1, masklen);
+ bpf_error(cstate, "non-network bits set in \"%s/%d\"", s, masklen);
}
switch (q.addr) {
struct block *gen_mcode(compiler_state_t *, const char *, const char *,
bpf_u_int32, struct qual);
#ifdef INET6
-struct block *gen_mcode6(compiler_state_t *, const char *, const char *,
- bpf_u_int32, struct qual);
+struct block *gen_mcode6(compiler_state_t *, const char *, bpf_u_int32,
+ struct qual);
#endif
struct block *gen_ncode(compiler_state_t *, const char *, bpf_u_int32,
struct qual);
| HID6 '/' NUM {
CHECK_PTR_VAL($1);
#ifdef INET6
- CHECK_PTR_VAL(($$.b = gen_mcode6(cstate, $1, NULL, $3,
+ CHECK_PTR_VAL(($$.b = gen_mcode6(cstate, $1, $3,
$$.q = $<blk>0.q)));
#else
bpf_set_error(cstate, "'ip6addr/prefixlen' not supported "
| HID6 {
CHECK_PTR_VAL($1);
#ifdef INET6
- CHECK_PTR_VAL(($$.b = gen_mcode6(cstate, $1, 0, 128,
+ CHECK_PTR_VAL(($$.b = gen_mcode6(cstate, $1, 128,
$$.q = $<blk>0.q)));
#else
bpf_set_error(cstate, "'ip6addr' not supported "