You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2017/10/20 00:34:01 UTC

[GitHub] mkiiskila closed pull request #41: nmxact; if request is too large to fit a single datagram, return error.

mkiiskila closed pull request #41: nmxact; if request is too large to fit a single datagram, return error.
URL: https://github.com/apache/mynewt-newtmgr/pull/41
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/nmxact/mgmt/transceiver.go b/nmxact/mgmt/transceiver.go
index 6d5f957..2f30e70 100644
--- a/nmxact/mgmt/transceiver.go
+++ b/nmxact/mgmt/transceiver.go
@@ -83,7 +83,9 @@ func (t *Transceiver) txPlain(txCb TxFn, req *nmp.NmpMsg, mtu int,
 	}
 
 	log.Debugf("Tx NMP request: %s", hex.Dump(b))
-
+	if t.isTcp == false && len(b) > mtu {
+		return nil, fmt.Errorf("Request too big")
+	}
 	frags := nmxutil.Fragment(b, mtu)
 	for _, frag := range frags {
 		if err := txCb(frag); err != nil {
@@ -127,6 +129,9 @@ func (t *Transceiver) txOmp(txCb TxFn, req *nmp.NmpMsg, mtu int,
 
 	log.Debugf("Tx OMP request: %s", hex.Dump(b))
 
+	if t.isTcp == false && len(b) > mtu {
+		return nil, fmt.Errorf("Request too big")
+	}
 	frags := nmxutil.Fragment(b, mtu)
 	for _, frag := range frags {
 		if err := txCb(frag); err != nil {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services