diff options
author | Josh Bailey <joshb@google.com> | 2012-03-24 08:35:20 -0700 |
---|---|---|
committer | Avneesh Sachdev <avneesh@opensourcerouting.org> | 2012-04-07 13:54:37 -0700 |
commit | 3f045a08812525505e165deea99a79447b44506b (patch) | |
tree | a5c944b0584e0e5a14908a2ac9476637e7c1d7e6 /isisd/isis_bpf.c | |
parent | 6902c69aa30a73ecd70ef8941518b541ca02b878 (diff) |
isisd: add Google's changes to IS-IS
Diffstat (limited to 'isisd/isis_bpf.c')
-rw-r--r-- | isisd/isis_bpf.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/isisd/isis_bpf.c b/isisd/isis_bpf.c index 05f11386..4d5b1651 100644 --- a/isisd/isis_bpf.c +++ b/isisd/isis_bpf.c @@ -301,7 +301,16 @@ int isis_send_pdu_bcast (struct isis_circuit *circuit, int level) { struct ether_header *eth; - int written; + int written, buflen; + + buflen = stream_get_endp (circuit->snd_stream) + LLC_LEN + ETHER_HDR_LEN; + if (buflen > sizeof (sock_buff)) + { + zlog_warn ("isis_send_pdu_bcast: sock_buff size %lu is less than " + "output pdu size %d on circuit %s", + sizeof (sock_buff), buflen, circuit->interface->name); + return ISIS_WARNING; + } stream_set_getp (circuit->snd_stream, 0); @@ -328,9 +337,7 @@ isis_send_pdu_bcast (struct isis_circuit *circuit, int level) stream_get_endp (circuit->snd_stream)); /* now we can send this */ - written = write (circuit->fd, sock_buff, - stream_get_endp (circuit->snd_stream) - + LLC_LEN + ETHER_HDR_LEN); + written = write (circuit->fd, sock_buff, buflen); return ISIS_OK; } |