]> git.proxmox.com Git - mirror_frr.git/blobdiff - python/clidef.py
zebra: Convert socket interface to use `union sockunion`
[mirror_frr.git] / python / clidef.py
index fe01a891624bf3bffb251e1dd01a0debfbf868df..a140ce3d5454404312181bb02dee46f542b311b7 100644 (file)
@@ -96,7 +96,7 @@ class IP4Handler(IPBase):
     code = Template('_fail = !inet_aton(argv[_i]->arg, &$varname);')
 class IP6Handler(IPBase):
     argtype = 'struct in6_addr'
-    decl = Template('struct in6_addr $varname = IN6ADDR_ANY_INIT;')
+    decl = Template('struct in6_addr $varname = {};')
     code = Template('_fail = !inet_pton(AF_INET6, argv[_i]->arg, &$varname);')
 class IPGenHandler(IPBase):
     argtype = 'const union sockunion *'
@@ -186,7 +186,7 @@ def process_file(fn, ofd, dumpfd, all_defun):
     filedata = clippy.parse(fn)
 
     for entry in filedata['data']:
-        if entry['type'] == 'DEFPY' or (all_defun and entry['type'].startswith('DEFUN')):
+        if entry['type'].startswith('DEFPY') or (all_defun and entry['type'].startswith('DEFUN')):
             cmddef = entry['args'][2]
             cmddef = ''.join([i[1:-1] for i in cmddef])
 
@@ -277,4 +277,4 @@ if __name__ == '__main__':
     process_file(args.cfile, ofd, dumpfd, args.all_defun)
 
     if args.o is not None:
-        clippy.wrdiff(args.o, ofd, [args.cfile, os.path.realpath(__file__)])
+        clippy.wrdiff(args.o, ofd, [args.cfile, os.path.realpath(__file__), sys.executable])