Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- usr.sbin/relayd/check_icmp.c.orig Tue Mar 20 17:52:56 2012
- +++ usr.sbin/relayd/check_icmp.c Mon Apr 2 13:54:30 2012
- @@ -67,10 +67,17 @@
- void
- icmp_init(struct relayd *env)
- {
- + int mib[2];
- + size_t len;
- icmp_setup(env, &env->sc_icmp_send, AF_INET);
- icmp_setup(env, &env->sc_icmp_recv, AF_INET);
- - icmp_setup(env, &env->sc_icmp6_send, AF_INET6);
- - icmp_setup(env, &env->sc_icmp6_recv, AF_INET6);
- + /* setup INET6 only if net.inet6 exist */
- + mib[0] = CTL_NET;
- + mib[1] = AF_INET6;
- + if (sysctl(mib, 2, NULL, &len, NULL, 0) != -1) {
- + icmp_setup(env, &env->sc_icmp6_send, AF_INET6);
- + icmp_setup(env, &env->sc_icmp6_recv, AF_INET6);
- + }
- env->sc_id = getpid() & 0xffff;
- }
Advertisement
Add Comment
Please, Sign In to add comment