]> git.ipfire.org Git - thirdparty/libnl.git/commitdiff
Allow parser callbacks to return NL_OK, NL_SKIP, NL_EXIT
authorThomas Graf <tgr@lsx.localdomain>
Thu, 15 May 2008 12:01:57 +0000 (14:01 +0200)
committerThomas Graf <tgr@lsx.localdomain>
Thu, 15 May 2008 12:01:57 +0000 (14:01 +0200)
Obsoletes internal P_ACCEPT/P_IGNORE

14 files changed:
include/netlink-local.h
lib/genl/ctrl.c
lib/netfilter/ct.c
lib/netfilter/log_msg.c
lib/netfilter/queue_msg.c
lib/route/addr.c
lib/route/class.c
lib/route/classifier.c
lib/route/link.c
lib/route/neigh.c
lib/route/neightbl.c
lib/route/qdisc.c
lib/route/route.c
lib/route/rule.c

index b7b9b7fba0034cc708c00be4a88d5719f2312c2f..ed398ad8c2cf8887d566a5014e80347330389a4b 100644 (file)
@@ -124,9 +124,6 @@ static inline int nl_cb_call(struct nl_cb *cb, int type, struct nl_msg *msg)
 #define __exit __attribute__ ((destructor))
 #define __deprecated __attribute__ ((deprecated))
 
-#define P_ACCEPT 0
-#define P_IGNORE 0
-
 #define min(x,y) ({ \
        typeof(x) _x = (x);     \
        typeof(y) _y = (y);     \
index f60cd1af06eac81e7b42f2bb5476b6cc8b28999e..13016420d10ce6ffa72f48b2f47902c126dbfa76 100644 (file)
@@ -128,11 +128,6 @@ static int ctrl_msg_parser(struct nl_cache_ops *ops, struct genl_cmd *cmd,
        }
 
        err = pp->pp_cb((struct nl_object *) family, pp);
-       if (err < 0)
-               goto errout;
-
-       err = P_ACCEPT;
-
 errout:
        genl_family_put(family);
        return err;
index beb1dc506ca72bbecf31595640c4a0bc29de6e48..2f111d661404cbd5de2c3545e865b7445219de54 100644 (file)
@@ -364,11 +364,6 @@ static int ct_msg_parser(struct nl_cache_ops *ops, struct sockaddr_nl *who,
                goto errout;
 
        err = pp->pp_cb((struct nl_object *) ct, pp);
-       if (err < 0)
-               goto errout;
-
-       err = P_ACCEPT;
-
 errout:
        nfnl_ct_put(ct);
        return err;
index 33de482535a3959f5cebea70e754b39f9c4b7f20..cad6ddd059105b36076c6473874c4a601ea0201c 100644 (file)
@@ -176,11 +176,6 @@ static int log_msg_parser(struct nl_cache_ops *ops, struct sockaddr_nl *who,
                goto errout;
 
        err = pp->pp_cb((struct nl_object *) msg, pp);
-       if (err < 0)
-               goto errout;
-
-       err = P_ACCEPT;
-
 errout:
        nfnl_log_msg_put(msg);
        return err;
index ec461a5f63f42734f6cdef61ae2ab27a9111dc26..68f25f26621acf81a0a10140e6e0e04ed38c9e9e 100644 (file)
@@ -154,11 +154,6 @@ static int queue_msg_parser(struct nl_cache_ops *ops, struct sockaddr_nl *who,
                goto errout;
 
        err = pp->pp_cb((struct nl_object *) msg, pp);
-       if (err < 0)
-               goto errout;
-
-       err = P_ACCEPT;
-
 errout:
        nfnl_queue_msg_put(msg);
        return err;
index 3e86bdebd41cc1cbc1d0287533dac5fe09592b32..999da7a10a8f080f86cdcb37c79cbd67575aa31c 100644 (file)
@@ -282,11 +282,6 @@ static int addr_msg_parser(struct nl_cache_ops *ops, struct sockaddr_nl *who,
        }
 
        err = pp->pp_cb((struct nl_object *) addr, pp);
-       if (err < 0)
-               goto errout;
-
-       err = P_ACCEPT;
-
 errout:
        rtnl_addr_put(addr);
 
index 20b59eea1ea3f4843a69cd37410899ea4a7658cd..1110565eb5b8ea1d387a0e1fe2687a00dd6a12ad 100644 (file)
@@ -53,11 +53,6 @@ static int class_msg_parser(struct nl_cache_ops *ops, struct sockaddr_nl *who,
        }
 
        err = pp->pp_cb((struct nl_object *) class, pp);
-       if (err < 0)
-               goto errout_free;
-
-       err = P_ACCEPT;
-
 errout_free:
        rtnl_class_put(class);
 errout:
index 9a2a9ac27fb40ac79949b0807a13e63c95e001bc..4b5ce9d2ee0889c52ef1d53daa48b58d69b3ecd8 100644 (file)
@@ -64,11 +64,6 @@ static int cls_msg_parser(struct nl_cache_ops *ops, struct sockaddr_nl *who,
        }
 
        err = pp->pp_cb((struct nl_object *) cls, pp);
-       if (err < 0)
-               goto errout_free;
-
-       err = P_ACCEPT;
-
 errout_free:
        rtnl_cls_put(cls);
 errout:
index b894cabb90542ae204205eb353f1c3dac4bc51d9..b889d6594009c8159d04088e69964ee62213f49a 100644 (file)
@@ -417,11 +417,6 @@ static int link_msg_parser(struct nl_cache_ops *ops, struct sockaddr_nl *who,
        }
 
        err = pp->pp_cb((struct nl_object *) link, pp);
-       if (err < 0)
-               goto errout;
-
-       err = P_ACCEPT;
-
 errout:
        rtnl_link_put(link);
        return err;
index 9541f20d8b9331b03a07212c602c68d01bd1204f..bec98cc728cb36de1bfa7c83a3e744de54e094a3 100644 (file)
@@ -317,11 +317,6 @@ static int neigh_msg_parser(struct nl_cache_ops *ops, struct sockaddr_nl *who,
        }
 
        err = pp->pp_cb((struct nl_object *) neigh, pp);
-       if (err < 0)
-               goto errout;
-
-       err = P_ACCEPT;
-
 errout:
        rtnl_neigh_put(neigh);
        return err;
index d34205a252345a568b783b5d0b3e29a893d3a83f..d6495be177975a4a748b6ac3b57c87456a0cd65b 100644 (file)
@@ -217,10 +217,6 @@ static int neightbl_msg_parser(struct nl_cache_ops *ops,
        }
 
        err = pp->pp_cb((struct nl_object *) ntbl, pp);
-       if (err < 0)
-               goto errout;
-
-       err = P_ACCEPT;
 errout:
        rtnl_neightbl_put(ntbl);
        return err;
index c8dd4d50a810c8bac8f3ca050195b565f1a2fe72..fe5a597f1299ca8387418e3e8f680cf135e908a2 100644 (file)
@@ -122,11 +122,6 @@ static int qdisc_msg_parser(struct nl_cache_ops *ops, struct sockaddr_nl *who,
        }
 
        err = pp->pp_cb((struct nl_object *) qdisc, pp);
-       if (err < 0)
-               goto errout_free;
-
-       err = P_ACCEPT;
-
 errout_free:
        rtnl_qdisc_put(qdisc);
 errout:
index 1c13e6e0aa658bb62eb641e50e90e5250397a3d7..613440fe4b454d55e9a7b6aaf03c06651eba8a79 100644 (file)
@@ -36,12 +36,8 @@ static int route_msg_parser(struct nl_cache_ops *ops, struct sockaddr_nl *who,
        if ((err = rtnl_route_parse(nlh, &route)) < 0)
                return err;
 
-       if ((err = pp->pp_cb((struct nl_object *) route, pp)) < 0)
-               goto errout;
+       err = pp->pp_cb((struct nl_object *) route, pp);
 
-       err = P_ACCEPT;
-
-errout:
        rtnl_route_put(route);
        return err;
 }
index 00163b0231332d24588edefae296b10757a32303..12a0d05d40e4a664a587ecd437dc425809b6caf4 100644 (file)
@@ -155,11 +155,6 @@ static int rule_msg_parser(struct nl_cache_ops *ops, struct sockaddr_nl *who,
         }
 
        err = pp->pp_cb((struct nl_object *) rule, pp);
-       if (err < 0)
-               goto errout;
-
-       err = P_ACCEPT;
-
 errout:
        rtnl_rule_put(rule);
        return err;