diff --git a/transporthandler.cpp b/transporthandler.cpp
index 1ffe911..d54fac8 100644
--- a/transporthandler.cpp
+++ b/transporthandler.cpp
@@ -734,30 +734,6 @@
 {
     return response(ccParamNotSupported);
 }
-/**
- * @brief is MAC address valid.
- *
- * This function checks whether the MAC address is valid or not.
- *
- * @param[in] mac - MAC address.
- * @return true if MAC address is valid else retun false.
- **/
-bool isValidMACAddress(const ether_addr& mac)
-{
-    // check if mac address is empty
-    if (stdplus::raw::equal(mac, ether_addr{}))
-    {
-        return false;
-    }
-    // we accept only unicast MAC addresses and  same thing has been checked in
-    // phosphor-network layer. If the least significant bit of the first octet
-    // is set to 1, it is multicast MAC else it is unicast MAC address.
-    if (mac.ether_addr_octet[0] & 1)
-    {
-        return false;
-    }
-    return true;
-}
 
 /**
  * @brief is a valid LAN channel.
@@ -898,10 +874,6 @@
         {
             auto mac = unpackT<ether_addr>(req);
             unpackFinal(req);
-            if (!isValidMACAddress(mac))
-            {
-                return responseInvalidFieldRequest();
-            }
             channelCall<setMACProperty>(channel, mac);
             return responseSuccess();
         }
@@ -913,12 +885,8 @@
             }
             auto netmask = unpackT<in_addr>(req);
             unpackFinal(req);
-            uint8_t prefix = netmaskToPrefix(netmask);
-            if (prefix < MIN_IPV4_PREFIX_LENGTH)
-            {
-                return responseInvalidFieldRequest();
-            }
-            channelCall<reconfigureIfAddr4>(channel, std::nullopt, prefix);
+            channelCall<reconfigureIfAddr4>(channel, std::nullopt,
+                                            netmaskToPrefix(netmask));
             return responseSuccess();
         }
         case LanParam::Gateway1:
@@ -963,10 +931,6 @@
                 lastDisabledVlan[channel] = vlan;
                 vlan = 0;
             }
-            else if (vlan == 0 || vlan == VLAN_VALUE_MASK)
-            {
-                return responseInvalidFieldRequest();
-            }
 
             channelCall<reconfigureVLAN>(channel, vlan);
             return responseSuccess();
diff --git a/transporthandler.hpp b/transporthandler.hpp
index db5df56..e34fb51 100644
--- a/transporthandler.hpp
+++ b/transporthandler.hpp
@@ -158,8 +158,6 @@
 constexpr uint8_t MAX_IPV6_DYNAMIC_ADDRESSES = 15;
 
 // Prefix length limits of phosphor-networkd
-constexpr uint8_t MIN_IPV4_PREFIX_LENGTH = 1;
-constexpr uint8_t MAX_IPV4_PREFIX_LENGTH = 32;
 constexpr uint8_t MIN_IPV6_PREFIX_LENGTH = 1;
 constexpr uint8_t MAX_IPV6_PREFIX_LENGTH = 128;
 
