GNOME Bugzilla – Bug 735991
pcapparse: add support for IPv6
Last modified: 2018-11-03 13:26:29 UTC
Created attachment 285288 [details] [review] Changes to add support for IPv6 and IP in IP tunneling pcapparse bad plugin don't support IPv6 packages, just IPv4. I made a patch to add IPv6 support, and tunneling 6in4 or 4in6. I've made the patch based in 0.10 branch, but since the code of function that decodes IP header don't changed, i think it will work in 1.x branches.
Thanks for the patch. Could you please create a patch in 'git format-patch' style format? (i.e. incl. full commit message and author etc.) And run gst-indent over the .c file, and convert the c++ comments into C comments please? Thanks! I can confirm that it does apply to git master, although it would still be good if you could make one on top of git master.
Ok, thank you for attention. I will do this changes and i will post here today later.
Created attachment 285409 [details] [review] patch, add IPv6 support, in git format-patch format Here is!
Review of attachment 285409 [details] [review]: Thanks for the patch :) ::: gst/pcapparse/gstpcapparse.c @@ +63,3 @@ PROP_DST_IP, + PROP_SRC_IP6, + PROP_DST_IP6, It should be possible to re-use the existing IP properties, and detect if the string is an IPv6 or IPv4 IP. @@ +256,3 @@ + return FALSE; + + //ret can be 1,0 or -1 No C99 comments @@ +563,3 @@ guint16 len; + struct in6_addr ip6_src_addr = { {{0}} }; /* This triple braces is a workaround for GCC bug 53119 */ + struct in6_addr ip6_dst_addr = { {{0}} }; /* this triple braces is a workaround for GCC bug 53119 */ Maybe just memset()?
Created attachment 285527 [details] [review] removing C99 comment, changing "{{{" for memset Ok, I did as you recommended. For new changes, should I post a patch with the last changes only or a full patch?
Comment on attachment 285527 [details] [review] removing C99 comment, changing "{{{" for memset A full patch please, and you forgot the first change I mentioned :) The one about the properties. Also please use your full name in the GIT config instead of just your first name
The decode_network_layer() function should be static. I get this warning: gstpcapparse.c: At top level: gstpcapparse.c:507:10: warning: no previous prototype for 'decode_network_layer' [-Wmissing-prototypes] gboolean decode_network_layer And the patch doesn't actually build: gstpcapparse.c: In function 'gst_pcap_parse_init': gstpcapparse.c:193:7: error: 'GstPcapParse' has no member named 'has_src_ip6' self->has_src_ip6 = FALSE; ^ gstpcapparse.c:194:7: error: 'GstPcapParse' has no member named 'has_dst_ip6' self->has_dst_ip6 = FALSE; ^ gstpcapparse.c: In function 'gst_pcap_parse_get_property': gstpcapparse.c:283:39: error: 'GstPcapParse' has no member named 'src_ip6' get_ip6_address_as_string (&self->src_ip6, ip_str); ^ gstpcapparse.c:288:39: error: 'GstPcapParse' has no member named 'dst_ip6' get_ip6_address_as_string (&self->dst_ip6, ip_str);
Any progress here?
Tested with version 1.8.3 - seems to work (after adding missing members in the header). Patches themselves require reformatting (please remove non-related code formatting change).
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/173.