Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
The FDP team is no longer accepting new bugs in Bugzilla. Please report your issues under FDP project in Jira. Thanks.

Bug 1857564

Summary: [OVN] OVN DHCP Server ignores DHCPDECLIENmessages from client
Product: Red Hat Enterprise Linux Fast Datapath Reporter: ying xu <yinxu>
Component: ovn2.11Assignee: lorenzo bianconi <lorenzo.bianconi>
Status: CLOSED ERRATA QA Contact: ying xu <yinxu>
Severity: medium Docs Contact:
Priority: medium    
Version: FDP 20.ECC: ctrautma, jishi, lorenzo.bianconi, mmichels, ovnteam, ralongi
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovn2.11-2.11.1-54.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1857563 Environment:
Last Closed: 2020-10-27 09:50:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1857563    
Bug Blocks:    

Description ying xu 2020-07-16 07:13:27 UTC
+++ This bug was initially created as a clone of Bug #1857563 +++

Description of problem:

[OVN] OVN DHCP Server ignores DHCPDECLIENmessages from client
Version-Release number of selected component (if applicable):
# rpm -qa|grep ovn
ovn2.13-20.06.1-2.el8fdp.x86_64
ovn2.13-host-20.06.1-2.el8fdp.x86_64
ovn2.13-central-20.06.1-2.el8fdp.x86_64

How reproducible:
always

Steps to Reproduce:
ovn doesnt support decline now. we have supported 7 kinds of dhcp packets.
declien is the last one.I think it's better to support it.

# ip netns exec vm2 /usr/libexec/platform-python ./decline.py
02:54:15.475836 IP (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto UDP (17), length 281)
    42.42.42.3.68 > 42.42.42.254.67: BOOTP/DHCP, Request from 00:00:00:00:00:02, length 253, xid 0x64cc9868, Flags [none]
	  Client-IP 42.42.42.2
	  Client-Ethernet-Address 00:00:00:00:00:02
	  Vendor-rfc1048 Extensions
	    Magic Cookie 0x63825363
	    DHCP-Message Option 53, length 1: Decline

# cat /var/log/ovn/ovn-controller.log
2020-07-16T06:54:15.476Z|00017|pinctrl(ovn_pinctrl0)|WARN|Invalid DHCP message type: 4

Actual results:
invalid dhcp message
Expected results:
should  handle it.

Additional info:

Comment 4 ying xu 2020-10-12 04:38:08 UTC
verified on version:
# rpm -qa|grep ovn
ovn2.11-2.11.1-54.el7fdp.x86_64
ovn2.11-central-2.11.2-54.el7fdp.x86_64
ovn2.11-host-2.11.1-54.el7fdp.x86_64

script:decline.py
#! /usr/bin/python

import sys
from scapy.all import *

def main():
    conf.checkIPaddr = False
    fam,hw =get_if_raw_hwaddr(conf.iface)
    sendp(Ether(src="00:00:00:00:00:01", dst="00:de:ad:ff:01:02")/IP(src='42.42.42.2',dst='42.42.42.254')/UDP(sport=68,dport=67)/BOOTP(ciaddr='42.42.42.2',chaddr=hw,xid=random.randint(0, 0xFFFFFFFF),)/DHCP(options=[("message-type","decline"),("server_id",'42.42.42.254'),("client_id",chr(1),hw),"end"]),iface="vm1")


if __name__ == "__main__":
        main()
ovn-nbctl show'
switch 038f43e6-3ae3-4a2a-a4aa-06d50851def5 (ls)
    port vm2
        addresses: ["00:00:00:00:00:02 42.42.42.3"]
    port vm1
        addresses: ["00:00:00:00:00:01 42.42.42.2"]

:: [ 11:32:12 ] :: [  BEGIN   ] :: Running 'ip netns exec vm1 /usr/libexec/platform-python ./decline.py'
.
Sent 1 packets.
:: [ 11:32:13 ] :: [   PASS   ] :: Command 'ip netns exec vm1 /usr/libexec/platform-python ./decline.py' (Expected 0, got 0)
:: [ 11:32:18 ] :: [  BEGIN   ] :: Running 'cat /var/log/openvswitch/ovn-controller.log|grep DECLINE'
2020-10-09T15:32:12.960Z|00010|pinctrl(ovn_pinctrl0)|INFO|DHCPDECLINE from 00:00:00:00:00:01, 42.42.42.2 duplicated
:: [ 11:32:18 ] :: [   PASS   ] :: Command 'cat /var/log/openvswitch/ovn-controller.log|grep DECLINE' (Expected 0, got 0)

Comment 6 errata-xmlrpc 2020-10-27 09:50:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (ovn2.11 bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4359