]> rtime.felk.cvut.cz Git - sojka/can-utils.git/commitdiff
Moved kernel parsing of netlink attributes into can_can_parse_attr().
authorOliver Hartkopp <socketcan@hartkopp.net>
Sat, 20 Feb 2010 20:41:24 +0000 (20:41 +0000)
committerOliver Hartkopp <socketcan@hartkopp.net>
Sat, 20 Feb 2010 20:41:24 +0000 (20:41 +0000)
Added functionalitiy to remove formerly created CAN GW jobs.

cangw.c

diff --git a/cangw.c b/cangw.c
index 5e1ddc580c72bd3609a30568ff88263fd12f624e..d6dff901cb53858a62b8c277700502aec84ce4f0 100644 (file)
--- a/cangw.c
+++ b/cangw.c
@@ -50,6 +50,7 @@
 #include <libgen.h>
 #include <string.h>
 #include <unistd.h>
+#include <errno.h>
 #include <sys/socket.h>
 #include <net/if.h>
 #include <linux/netlink.h>
@@ -305,10 +306,15 @@ int main(int argc, char **argv)
        switch (cmd) {
 
        case ADD:
-               req.n.nlmsg_flags = NLM_F_REQUEST | NLM_F_CREATE | NLM_F_EXCL;
+               req.n.nlmsg_flags = NLM_F_REQUEST;
                req.n.nlmsg_type  = RTM_NEWROUTE;
                break;
 
+       case DEL:
+               req.n.nlmsg_flags = NLM_F_REQUEST;
+               req.n.nlmsg_type  = RTM_DELROUTE;
+               break;
+
        default:
                printf("This function is not yet implemented.\n");
                exit(1);