Skip to content

Commit

Permalink
Number FIXME/TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
juga0 committed Jul 15, 2017
1 parent 09a7932 commit b3aca43
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions dhcpcanon/dhcpcap.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def gen_check_lease_attrs(self, attrs_dict):
# (AddrFormatError)
ipn = IPNetwork(attrs_dict['address'] + '/' +
attrs_dict['subnet_mask'])
# FIXME: should be this option required?
# FIXME:70 should be this option required?
# assert attrs_dict['server_id']
if attrs_dict.get('server_id') is None:
attrs_dict['server_id'] = self.server_ip
Expand Down Expand Up @@ -349,8 +349,8 @@ def handle_ack(self, pkt, time_sent_request):
self.server_ip = pkt[IP].src
self.server_port = pkt[UDP].sport
event = DHCP_EVENTS['IP_ACQUIRE']
# FIXME: check the fields match the previously offered ones?
# FIXME: create a new object also on renewing/rebinding
# FIXME:0 check the fields match the previously offered ones?
# FIXME:50 create a new object also on renewing/rebinding
# or only set_times?
lease = self.handle_offer_ack(pkt, time_sent_request)
lease.set_times(time_sent_request)
Expand Down
12 changes: 6 additions & 6 deletions dhcpcanon/dhcpcapfsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def send_discover(self):
self.current_state == STATE_SELECTING
pkt = self.client.gen_discover()
sendp(pkt)
# FIXME: check that this is correct,: all or only discover?
# FIXME:20 check that this is correct,: all or only discover?
if self.discover_attempts < MAX_ATTEMPTS_DISCOVER:
self.discover_attempts += 1
timeout = gen_timeout_resend(self.discover_attempts)
Expand Down Expand Up @@ -203,7 +203,7 @@ def send_request(self):
self.client.iface, self.client.client_ip,
self.client.server_ip, self.client.server_port)

# FIXME: check that this is correct,: all of only discover?
# FIXME:10 check that this is correct,: all of only discover?
# and if > MAX_DISCOVER_RETRIES?
if self.request_attempts < MAX_ATTEMPTS_REQUEST:
self.request_attempts *= 2
Expand Down Expand Up @@ -248,7 +248,7 @@ def process_received_ack(self, pkt):
"""
if isack(pkt):
# FIXME: check the fields match the previously offered ones?
# FIXME:30 check the fields match the previously offered ones?
try:
self.event = self.client.handle_ack(pkt,
self.time_sent_request)
Expand Down Expand Up @@ -325,7 +325,7 @@ def receive_offer(self, pkt):
self.select_offer()
raise self.REQUESTING()
else:
# FIXME: neeeded?
# FIXME:60 neeeded?
raise self.SELECTING()

@ATMT.action(receive_offer)
Expand All @@ -349,7 +349,7 @@ def timeout_selecting(self):
logger.debug('No offer was received')
raise self.ERROR()
else:
# FIXME: correct?
# FIXME:40 correct?
logger.debug('needed? Use the offers received')
raise self.REQUESTING()
# else self.discover_attempts < MAX_ATTEMPTS_DISCOVER
Expand Down Expand Up @@ -447,7 +447,7 @@ def renewing_time_expires(self):
@ATMT.action(renewing_time_expires)
def on_renewing_time_expires(self):
"""Action on renewing time expires on BOUND state."""
# FIXME: udp
# FIXME:100 udp
self.send_request()

@ATMT.state()
Expand Down
4 changes: 2 additions & 2 deletions dhcpcanon/timers.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def gen_renewing_time(lease_time, elapsed=0):
"""
renewing_time = int(lease_time) * RENEW_PERC - elapsed
# FIXME: the random intervals here could deanonymize
# FIXME:80 the random intervals here could deanonymize
range_fuzz = int(lease_time) * REBIND_PERC - renewing_time
logger.debug('rebinding fuzz range %s', range_fuzz)
fuzz = random.uniform(-(range_fuzz),
Expand All @@ -132,7 +132,7 @@ def gen_renewing_time(lease_time, elapsed=0):
def gen_rebinding_time(lease_time, elapsed=0):
"""."""
rebinding_time = int(lease_time) * REBIND_PERC - elapsed
# FIXME: the random intervals here could deanonymize
# FIXME:90 the random intervals here could deanonymize
range_fuzz = int(lease_time) - rebinding_time
logger.debug('rebinding fuzz range %s', range_fuzz)
fuzz = random.uniform(-(range_fuzz),
Expand Down
2 changes: 1 addition & 1 deletion tests/test_dhcpcapfsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def test_round_trip(self):
logger.debug('Test timeout selecting %s',
dhcpcanon.get_timeout(dhcpcanon.current_state,
dhcpcanon.timeout_selecting))
# FIXME: why is needed here to press enter to don't retransmit?
# FIXME:110 why is needed here to press enter to don't retransmit?
try:
dhcpcanon.next()
except Automaton.Singlestep as err:
Expand Down

0 comments on commit b3aca43

Please sign in to comment.