diff options
author | julian <julian@FreeBSD.org> | 1997-07-18 11:08:35 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1997-07-18 11:08:35 +0000 |
commit | bb9437716d65e93d956fb96425c754125a6aa4e6 (patch) | |
tree | 9096b7fd297a2cc32fbdff209c2fd19796960983 /sbin/routed/table.c | |
parent | 8bdc2de5821f86489ee2b3500d24c78570667f56 (diff) | |
download | FreeBSD-src-bb9437716d65e93d956fb96425c754125a6aa4e6.zip FreeBSD-src-bb9437716d65e93d956fb96425c754125a6aa4e6.tar.gz |
Check if routed had the same problems that route(1) had.
The answer is not really, but almost.
it sent data that was ok, though it was a hack,
but it was bug-compatible with the kernel on receiving them. This also
had been fixed with a hack.. I hacked it better I think.
Diffstat (limited to 'sbin/routed/table.c')
-rw-r--r-- | sbin/routed/table.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sbin/routed/table.c b/sbin/routed/table.c index a7c2303..e224d41 100644 --- a/sbin/routed/table.c +++ b/sbin/routed/table.c @@ -612,8 +612,8 @@ rtm_type_name(u_char type) /* Trim a mask in a sockaddr - * Produce a length of 0 for an address of 0. - * Otherwise produce the index of the first zero byte. + * Produce the index of the first zero byte. + * i.e. Produce a index of 4 for an mask of 0. (default route) */ void #ifdef _HAVE_SIN_LEN @@ -624,13 +624,11 @@ masktrim(struct sockaddr_in_new *ap) { register char *cp; - if (ap->sin_addr.s_addr == 0) { - ap->sin_len = 0; - return; - } + ap->sin_port = 0xffff; /* buffer zone for default route */ cp = (char *)(&ap->sin_addr.s_addr+1); while (*--cp == 0) continue; + /*ap->sin_port = 0x0;*/ /* may not be needed (who cares?)*/ ap->sin_len = cp - (char*)ap + 1; } @@ -685,8 +683,6 @@ again: w.w_mask.sin_addr.s_addr = htonl(mask); #ifdef _HAVE_SA_LEN masktrim(&w.w_mask); - if (w.w_mask.sin_len == 0) - w.w_mask.sin_len = sizeof(long); w.w_rtm.rtm_msglen -= (sizeof(w.w_mask) - w.w_mask.sin_len); #endif } |