Skip to content

Commit

Permalink
Fix issue #57: Revert parts of fix for issue #23, commit 28bbf4e for BSD
Browse files Browse the repository at this point in the history
This is a speculative, but very probable, fix for the FreeBSD regression
reported in issue #57.  In 28bbf4e two new checks for BSD `SOCK_RAW` was
added, which seems didn't apply at all.

Turns out PIM register messages, both send & receive, are in fact passed
as truly RAW.  At least on FreeBSD.  This fix only reverts checks added
to IGMP_PROTO sockets.

Signed-off-by: Joachim Nilsson <[email protected]>
  • Loading branch information
troglobit committed Dec 31, 2015
1 parent bf9e159 commit 4e706d4
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions pim_proto.c
Original file line number Diff line number Diff line change
Expand Up @@ -949,11 +949,7 @@ int send_pim_register(char *packet)
buf += sizeof(pim_register_t);

/* Copy the data packet at the back of the register packet */
#ifdef HAVE_IP_HDRINCL_BSD_ORDER
pktlen = ip->ip_len;
#else
pktlen = ntohs(ip->ip_len);
#endif
memcpy(buf, ip, pktlen);

pktlen += sizeof(pim_register_t); /* 'sizeof(struct ip) + sizeof(pim_header_t)' added by send_pim() */
Expand Down Expand Up @@ -996,11 +992,7 @@ int send_pim_null_register(mrtentry_t *mrtentry)
ip->ip_id = 0;
ip->ip_off = 0;
ip->ip_p = IPPROTO_UDP; /* XXX: bogus */
#ifdef HAVE_IP_HDRINCL_BSD_ORDER
ip->ip_len = sizeof(struct ip);
#else
ip->ip_len = htons(sizeof(struct ip));
#endif
ip->ip_ttl = MINTTL; /* TODO: XXX: check whether need to setup the ttl */
ip->ip_src.s_addr = mrtentry->source->address;
ip->ip_dst.s_addr = mrtentry->group->group;
Expand Down

0 comments on commit 4e706d4

Please sign in to comment.