Skip to content

Commit

Permalink
lldpd: Fix return value convention for "send" function.
Browse files Browse the repository at this point in the history
errno values are positive values, so it's not reasonable to use E2BIG as
an error return with positive values also indicating packet lengths.

Signed-off-by: Ben Pfaff <blp@nicira.com>
  • Loading branch information
blp committed Mar 4, 2015
1 parent 809fd54 commit a268e13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/lldp/lldpd.c
Expand Up @@ -599,7 +599,7 @@ lldpd_send(struct lldpd_hardware *hw, struct dp_packet *p)
/* We send only if we have at least one remote system
* speaking this protocol or if the protocol is forced */
if (cfg->g_protocols[i].enabled > 1) {
if ((lldp_size = cfg->g_protocols[i].send(cfg, hw, p)) != E2BIG) {
if ((lldp_size = cfg->g_protocols[i].send(cfg, hw, p)) != -E2BIG) {
sent++;
continue;
} else {
Expand Down

0 comments on commit a268e13

Please sign in to comment.