NetworkPkg: Correct the DNS token return status by RCODE
authorJiaxin Wu <jiaxin.wu@intel.com>
Wed, 14 Sep 2016 06:43:45 +0000 (14:43 +0800)
committerJiaxin Wu <jiaxin.wu@intel.com>
Tue, 20 Sep 2016 01:12:20 +0000 (09:12 +0800)
commit0a92ac8802704d7281ff7b9bc00ec4f893c3ece2
tree5408a5633c0e56218d040ac2f39752d27aef87f7
parent490acf8908f797982f367bfeb4bdf3ebe0764e42
NetworkPkg: Correct the DNS token return status by RCODE

When HostNameToIp() and GeneralLookUp() are called with a invalid
host name, RCODE (4 bit field is set as part of responses) error
will returned in packet to identify the domain name referenced in
the query does not exist. So, EFI_NOT_FOUND should be returned
directly.

Current implementation only check the RCODE in successful condition.
Need update the code for more error check according to RFC 1035 4.1.1
section.

Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Tested-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
NetworkPkg/DnsDxe/DnsImpl.c