ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/src/vpn.C
(Generate patch)

Comparing gvpe/src/vpn.C (file contents):
Revision 1.69 by root, Sat Sep 5 17:40:22 2015 UTC vs.
Revision 1.71 by root, Thu Oct 6 03:25:54 2022 UTC

255 icmpv4_fd = setup_socket (PROT_ICMPv4, PF_INET, SOCK_RAW, IPPROTO_ICMP); 255 icmpv4_fd = setup_socket (PROT_ICMPv4, PF_INET, SOCK_RAW, IPPROTO_ICMP);
256 256
257 if (icmpv4_fd < 0) 257 if (icmpv4_fd < 0)
258 return -1; 258 return -1;
259 259
260// no clue where trhis is actually defined
261#if !defined(ICMP_FILTER) && defined(__linux)
262 #define ICMP_FILTER 1
263#endif
264
260#ifdef ICMP_FILTER 265#ifdef ICMP_FILTER
261 { 266 {
262 icmp_filter oval; 267 uint32_t oval;
263 oval.data = 0xffffffff; 268 oval = 0;
264 if (::conf.icmp_type < 32) 269 if (::conf.icmp_type < 32)
265 oval.data &= ~(1 << ::conf.icmp_type); 270 oval |= 1 << ::conf.icmp_type;
271 oval = ~oval;
266 272
267 setsockopt (icmpv4_fd, SOL_RAW, ICMP_FILTER, &oval, sizeof oval); 273 setsockopt (icmpv4_fd, SOL_RAW, ICMP_FILTER, &oval, sizeof oval);
268 } 274 }
269#endif 275#endif
270 276

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines