summaryrefslogtreecommitdiff
path: root/isisd/isis_bpf.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2012-04-16 18:24:40 +0200
committerDavid Lamparter <equinox@diac24.net>2012-04-16 18:24:43 +0200
commitd75318cc8de91d94649106f4ea3122d0d21ac9eb (patch)
tree6d7c674c4026bccd1384e60ee228d8d67750fbf7 /isisd/isis_bpf.c
parent6e493a44836d3b034ed3421e866878de3fbfcc5b (diff)
parent48d8bea8b7c83cf186460f711ab166455b5ed676 (diff)
isisd: merge osr/google-is-is
this is essentially half of a rewrite of isisd. please note that a lot of things are still broken and isisd is not ready for production use.
Diffstat (limited to 'isisd/isis_bpf.c')
-rw-r--r--isisd/isis_bpf.c15
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;
}