[ovs-dev] [PATCH 24/32] lldpd: Fix return value convention for "send" function.

Ben Pfaff blp at nicira.com
Mon Feb 23 05:20:16 UTC 2015


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 at nicira.com>
---
 lib/lldp/lldpd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/lldp/lldpd.c b/lib/lldp/lldpd.c
index 06f8ea0..4467960 100644
--- a/lib/lldp/lldpd.c
+++ b/lib/lldp/lldpd.c
@@ -598,7 +598,7 @@ lldpd_send(struct lldpd_hardware *hw, struct ofpbuf *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 {
-- 
2.1.3




More information about the dev mailing list