Solicited Multicast Address

15 views
Skip to first unread message

Jason Nadeau

unread,
Sep 11, 2014, 9:11:48 AM9/11/14
to ipaddr...@googlegroups.com
So, I am very new to Python and version control however I think I have a patch here that will add a method to return the Solicited Multicast address for an IPv6Address instance. I'll be honest I spent 5 minutes trying to figure out how to submit this patch the proper way and just gave up because its a useful method to me but not enough to overcome the learning curve for the patching system. So I will drop a copy here. Feel free to have it, I have signed the CLA document as an individual so you should be able to use it. I welcome feedback I am sure this code is not very clear or pythonic.

Index: trunk/ipaddr.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- trunk/ipaddr.py (date 1406391300000)
+++ trunk/ipaddr.py (revision )
@@ -1813,7 +1813,15 @@
         # which converts into a formatted IP string.
         addr_str = str(address)
         self._ip = self._ip_int_from_string(addr_str)
-
+    def solicitedMulticastAddress(self):
+        '''Returns IPv6Address Object with value of Solicited Multicast Address
+        Unless IPv6Address is multicast then return None'''
+        if self.is_multicast:
+            return None
+        solicitedMulticastPrefix = 'ff02:0000:0000:0000:0000:0001:ff{}'
+        hostBits = self.exploded[-7:]
+        hostSMA = IPv6Address(solicitedMulticastPrefix.format(hostBits))
+        return hostSMA
 
 class IPv6Network(_BaseV6, _BaseNet):
 


Peter Moody

unread,
Sep 15, 2014, 1:07:42 PM9/15/14
to Jason Nadeau, ipaddr...@googlegroups.com

Hey Jason,

Normally we use Rietveld for reviewing patches (see the patches section
on the landing page), but this is pretty small so it's probably not a
big deal. I keep forgetting how to check this internally, but have you
signed the contributor license agreement?
(https://developers.google.com/open-source/cla/individual?csw=1). It's
needed before I can merge. Also, adding a test for this is highly
encouraged.

Cheers,
peter

Jason Nadeau

unread,
Sep 15, 2014, 1:48:48 PM9/15/14
to ipaddr...@googlegroups.com
Yes I have signed the CLA. I will take a crack at the unit test for this method.
Reply all
Reply to author
Forward
0 new messages